package parts4.lesson52;

import java.util.Arrays;

/**
 * 课时52 Arrays类
 * java.util类中
 * 这个类提供：二分查找、拷贝、填充、排序、比较
 */
public class ArraysDemo {
    public static void main(String[] args) {
        int data[]=new int[]{1,2,3,4,5,6,7};
        int data2[]=new int[]{1,2,3,4,5,6,7};
        System.out.println(Arrays.toString(data));

        System.out.println(Arrays.equals(data,data2));

        System.out.println("二分查找，第一个是第0个");
        System.out.println(Arrays.binarySearch(data, 1));
        System.out.println("二分查找，找不到的时候，则返回负数的个数总和+1，上边返回-8");
        System.out.println(Arrays.binarySearch(data, 100));
    }
}
